Skip to main content
Version: 16.10.0

helpers

FileTypeEnumSuccess

error_list

error_list = FileTypeEnumError.__subclasses__()

success_list

success_list = FileTypeEnumSuccess.__subclasses__()

int_str_map

int_str_map = {
fte_class.integer: fte_class.string
for fte_class in error_list + success_li ...

str_int_map

str_int_map = {
fte_class.string: fte_class.integer
for fte_class in error_list + success_li ...

int_class_map

int_class_map = {
fte_class.integer: fte_class
for fte_class in error_list + success_list
...

is_success

def is_success(file_type: Union[int, str, FileTypeEnumError,
FileTypeEnumSuccess])

Checks if a file type corresponds to a success.

Arguments:

  • file_type Union[int, str, FileTypeEnumError, FileTypeEnumSuccess] - An enum int returned by Glasswall, str representation of file type, or subclass of FileTypeEnum.

Returns:

  • bool - Returns True if file_type corresponds to a successful file type, else False.

file_type_int_to_str

def file_type_int_to_str(integer: int)

Converts a file type enum int to a string.

Arguments:

  • integer int - The enum int that Glasswall returns when ing a file type.

Returns:

Union[type(None), str]: The string representation of a file type, or None.

file_type_str_to_int

def file_type_str_to_int(string: str)

Converts a file type string to an enum int.

Arguments:

  • string str - A string representation of a file type.

Returns:

Union[type(None), int]: The enum int that Glasswall returns when determining a file type, or None.